package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2021-01-29
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_base_area_info")
@ApiModel(value = "BaseAreaInfo", description = "")
@AllArgsConstructor
public class BaseAreaInfo extends Entity<String> {

    private static final long serialVersionUID = 1L;

    /**
     * 编码
     */
    @ApiModelProperty(value = "编码")
    @Length(max = 32, message = "编码长度不能超过32")
    @TableField(value = "code", condition = LIKE)
    @Excel(name = "编码")
    private String code;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    @Length(max = 32, message = "名称长度不能超过32")
    @TableField(value = "name", condition = LIKE)
    @Excel(name = "名称")
    private String name;

    /**
     * 类型
     */
    @ApiModelProperty(value = "类型")
    @Length(max = 32, message = "类型长度不能超过32")
    @TableField(value = "type", condition = LIKE)
    @Excel(name = "类型")
    private String type;

    /**
     * 上级编码
     */
    @ApiModelProperty(value = "上级编码")
    @Length(max = 32, message = "上级编码长度不能超过32")
    @TableField(value = "parent", condition = LIKE)
    @Excel(name = "上级编码")
    private String parent;

    @ApiModelProperty(value = "")
    @Length(max = 32, message = "长度不能超过32")
    @TableField(value = "sxy_code", condition = LIKE)
    @Excel(name = "")
    private String sxyCode;


    @Builder
    public BaseAreaInfo(String id, String createUser, LocalDateTime createTime, String updateUser, LocalDateTime updateTime, 
                    String code, String name, String type, String parent, String sxyCode) {
        this.id = id;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.updateTime = updateTime;
        this.code = code;
        this.name = name;
        this.type = type;
        this.parent = parent;
        this.sxyCode = sxyCode;
    }

}
